<template>
    <div class="flex_sb width_100">
        <el-input-number 
            :controls='false' 
            type="number" 
            :min="minV"
            :max="vEnd ? vEnd : maxV"
            v-model="vStart" 
            class="number" 
            placeholder="请输入"
        />
            <span class="post">
            -
            </span>
        <el-input-number 
            :controls='false' 
            type="number" 
            :min="vStart"
            :max="maxV"
            v-model="vEnd" 
            class="number"
            placeholder="请输入"
        />
    </div>
</template>


<script setup lang="ts">
/**
 * @import
 */

/**
 * @porps
 */

defineProps({
    // 最大值
    maxV: {
        type: Number,
        default: 10000 * 10000,
    },
    minV: {
        type: Number,
        default: 0,
    }
})

const vStart = ref<any>('')
const vEnd = ref<any>('')

/**
 * @var
 */

/**
 * @method
 */

//  重置
const reset = () => {
    vStart.value = ''
    vEnd.value = ''
}

defineExpose({
    vStart,
    vEnd,
    reset: reset
})

onMounted(() => {
    reset()
})

</script>

<style scoped lang="scss">
.post {
    padding: 0 4px;
}

.number {
    width: 47%;
}
</style>